package com.aqiang.core.mvp.view;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.aqiang.core.mvp.presenter.IPresenter;

public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivity implements IView {
    protected P mPresenter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(bindLayout());
        initView();
        initData();
        initEvent();
    }
    protected abstract int bindLayout();
    protected abstract void initView();
    protected abstract void initData();
    protected abstract void initEvent();

    protected void showToast(String s){
        Toast.makeText(this, ""+s, Toast.LENGTH_SHORT).show();
    }
}
